<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<base href="<%=basePath%>">
		<title>Article Center</title>
		
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		
		<script charset="utf-8" src="editor/kindeditor.js"></script>
		<script>
			KE.show({
				id : 'editor',
				imageUploadJson : '../../../imageUpload',
				allowFileManager : true,
				afterCreate : function(id) {
					KE.event.ctrl(document, 13, function() {
						KE.util.setData(id);
						document.forms['article'].submit();
					});
					KE.event.ctrl(KE.g[id].iframeDoc, 13, function() {
						KE.util.setData(id);
						document.forms['article'].submit();
					});
				}
			});
		</script>
		
		<link rel="stylesheet" type="text/css" href="style/basic.css" />
		<style>
			#editor {
				width: 600px;
				height: 400px;
			}
		</style>
	</head>
	<body>
		<table>
		<c:forEach items="${articles }" var="article">
			<tr>
				
				<td>${article.id }</td>
				<td><a href="${article.url }">${article.title }</a></td>
				<td><a href="">修改</a></td>
				<td><a href="article/delete/${article.id }">删除</a></td>
			</tr>
		</c:forEach>
		</table>
		<br />
		
		<form name="article" action="article/insert" method="POST">
			<p><input id="title" name="title" type="text" size="90"/>(*)</p>
			<textarea id="editor" name="content">
				Continue to my little site smoothly ...
			</textarea>
			<p><input type="submit" type="button" value="提交" /> (快捷键: Ctrl + Enter)</p>
		</form>
	</body>
</html>